<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/font/css/font-awesome.min.css}"/>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <!--[if lte IE 8]>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace-ie.min.css}"/>
    <![endif]-->
    <script th:src="@{/erp/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>
    <script th:src="@{/erp/js/displayPart.js}" type="text/javascript"></script>
    <script>
        $("#pd").click(function () {
            window.location.href = "inventory_adjustment.html";
        })
    </script>
    <title>仓库转移</title>
</head>

<body>
<div class="margin clearfix">
    <div class="Shops_Audit">
        <!---->
        <div class="border clearfix"><span class="l_f"> <a href="javascript:;" id="property_add"
                                                           class="btn btn-warning"><i
                class="icon-plus"></i>移库操作</a>  </span></div>
        <!---->

        <!--申请列表-->
        <div class="audit_list">
            <table class="table table-striped table-bordered table-hover" id="main-table">
                <thead>
                <tr>
                    <th width="80px">序号</th>
                    <th width="80px">移库单号</th>
                    <th width="80px">移出仓库</th>
                    <th width="80px">移入仓库</th>
                    <th width="100">转移商品</th>
                    <th width="100">转移数量</th>
                    <th width="80px">移库原因</th>
                    <th width="100">移库负责人</th>
                    <th width="100">联系电话</th>
                    <th width="200px">移库时间</th>
                    <th width="100px">操作</th>
                    <th hidden="hidden"></th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
</div>
<!--销售区域分配图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
    <form>
        <ul class=" page-content">
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>移出库名：</label>
                <div class="formControls " style="width:280px;">
                    <select style="margin-left:10px;" id="iomName" name="outwarehouse">
                        <option value="">请选择仓库</option>
                    </select>
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>转移商品名称：</label>
                <div class="formControls ">
                    <input type="text" class="input-text" value="" placeholder="" id="iomGoods" name="production">
                    <input type="button" id="search" value="搜索"/>
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <table class="table table-striped table-bordered table-hover" id="outTable">
                    <thead>
                    <tr>
                        <th width="70">序号</th>
                        <th width="100">产品码</th>
                        <th width="100">商品名称</th>
                        <th width="100">仓库名称</th>
                        <th width="100">货区名称</th>
                        <th width="100">货架编号</th>
                        <th width="100">货位编号</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>移入库名：</label>
                <div class="formControls ">
                    <select style="margin-left:10px;" id="inwarehouse" name="inwarehouse">
                        <option value="">请选择仓库</option>
                    </select>
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <table class="table table-striped table-bordered table-hover" id="inTable">
                    <thead>
                    <tr>
                        <th width="70">序号</th>
                        <th width="100">产品码</th>
                        <th width="100">商品名称</th>
                        <th width="100">入库库名</th>
                        <th width="100">入库区域</th>
                        <th width="100">入库货架</th>
                        <th width="100">入库货位</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>

            <div class="Operate_cont clearfix">
                <ul class="Info_style clearfix" style="width:700px; margin-left:30px;">
                    <li><label class="label_name">*负责人：</label> <span class="name"><input type="text" class="input-text"
                                                                                         value="" placeholder=""
                                                                                         id="user-name"
                                                                                         name="person"></span></li>
                    <li><label class="label_name">*联系电话：</label><span class="name"><input type="text" class="input-text"
                                                                                         value="" placeholder=""
                                                                                         id="tel" onblur="judge()"
                                                                                         name="tel"></span></li>
                    <li><label class="label_name">*移库时间：</label> <span class="name"> <input type="text"
                                                                                           class="inline laydate-icon"
                                                                                           value="" id="start3"
                                                                                           name="time"></span></li>
                    <li><label class="label_name">*转移数量：</label><span class="name"><input type="text" class="input-text"
                                                                                         value="" placeholder=""
                                                                                         id="number"
                                                                                         onblur="judge_two()"
                                                                                         name="number"></span></li>
                    <li style="width:700px;"><label class="label_name">移库原因：</label><span class="name"><textarea
                            style="width:505px;height:100px;" name="reason"></textarea></span></li>
                </ul>
            </div>
        </ul>
    </form>
</div>
<!--销售区域分配图层-->
<div class="list_menber" id="list_menber_style" style="display:none">
    <ul class=" page-content">
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>移出库名：</label>
            <div class="formControls " style="width:280px;">
                <span style="margin-left:10px;" id="outwarehouse"></span>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>转移商品名称：</label>
            <div class="formControls ">
                <span style="margin-left:10px;" id="product"></span>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <table class="table table-striped table-bordered table-hover" id="check_one-table">
                <thead>
                <tr>
                    <th width="70">序号</th>
                    <th width="100">产品码</th>
                    <th width="100">商品名称</th>
                    <th width="100">出库库名</th>
                    <th width="100">出库货区</th>
                    <th width="100">出库货架</th>
                    <th width="100">出库货位</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label"><span class="c-red">*</span>移入库名：</label>
            <div class="formControls ">
                <span style="margin-left:10px;" id="interware"></span>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <table class="table table-striped table-bordered table-hover" id="check_two-table">
                <thead>
                <tr>
                    <th width="70">序号</th>
                    <th width="100">产品码</th>
                    <th width="100">商品名称</th>
                    <th width="100">入库库名</th>
                    <th width="100">入库区域</th>
                    <th width="100">入库货架</th>
                    <th width="100">入库货位</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>

        <div class="Operate_cont clearfix">
            <ul class="Info_style clearfix" style="width:700px; margin-left:30px; float:left;">
                <li style="width:300px; float:left;"><label class="label_name">负责人：</label> <span class="name"><span
                        style="margin-left:10px;" id="name"></span></span></li>
                <li style="width:300px; float:left;"><label class="label_name">联系电话：</label><span class="name"><span
                        style="margin-left:10px;" id="telp"></span></span></li>
                <li style="width:300px; float:left;"><label class="label_name">移库时间：</label> <span class="name"><span
                        style="margin-left:10px;" id="time"></span></span></li>
                <li style="width:300px; float:left;"><label class="label_name">转移数量：</label><span class="name"><span
                        style="margin-left:10px;" id="num"></span></span></li>
                <li style="width:700px;  float:left;"><label class="label_name">移库原因：</label><span class="name"><span
                        style="margin-left:10px;" id="reason"></span></span></li>
            </ul>
        </div>
    </ul>
</div>
</body>
</html>
<script>
    /*判断手机号格式的正则表达式*/
    var test2 = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;

    /*移库输入框格式判断函数-2：判断输入的移库数量是否与表单数据一致*/
    function judge_two() {
        var tbody = $("#inTable tbody").find("tr").length;
        var number = $("#number").val();
        if (number != tbody) {
            $('#number').css("border", "1px solid #f00")
            layer.msg("请输入正确的数量！", {icon: 2, time: 1000});
            $('#number').val("");
            return;
        } else {
            $('#number').css("border", "1px solid #98FB98")
        }
    }

    /*移库输入框格式判断函数-1：判断输入的电话号码格式是否正确*/
    function judge() {
        if (!test2.test($('#tel').val())) {
            $('#tel').css("border", "1px solid #f00")
            layer.msg("联系电话格式错误！", {icon: 2, time: 1000});
            $('#tel').val("");
            return;
        } else {
            $('#tel').css("border", "1px solid #98FB98")
        }
    }

    /*时间框函数*/
    laydate.render({
        elem: '#start3',
        type: 'date'
    });

    /*下拉框改变事件—货区改变事件，改变货区搜寻该货区下的货架*/
    function area(obj, eq, md) {
        var area = $(obj).parent().parent().children("td:eq(4)").children("select:eq(0)").val();
        if (area == '') {
            layer.msg("请选择货区！", {icon: 2, time: 1000});
            $('.' + eq).empty();
            $('.' + md).empty();
            $('.' + eq).append("<option value=''>请选择货架</option>");
            $('.' + md).append("<option value=''>请选择货位</option>");
        } else {
            $.ajax({
                url: "[[@{/transfer/findShelves}]]",
                data: {
                    id: area
                },
                type: 'get',
                dataType: 'json',
                success: function (data) {
                    if(data.rs){
                        var data = data.data;
                        $('.' + eq).empty();
                        $('.' + md).empty();
                        $('.' + eq).append("<option value=''>请选择货架</option>");
                        $('.' + md).append("<option value=''>请选择货位</option>");
                        for (var i in data) {
                            $('.' + eq).append("<option value=" + data[i].id + ">" + data[i].shelvesNo + "</option>")
                        }
                    }else{
                        layer.msg(data.msg,{icon:2,time:2000});
                    }
                }
            })
        }
    }
    /*下拉框改变事件—*货架改变事件*，改变*货架*搜寻该货架下的*货位**/
    function shelves(obj, eq) {
        var shelves = $(obj).parent().parent().children("td:eq(5)").children("select:eq(0)").val();
        $.ajax({
            url: "[[@{/transfer/findCargo}]]",
            data: {
                id: shelves
            },
            type: 'get',
            dataType: 'json',
            success: function (data) {
                if(data.rs){
                    var data = data.data;
                    $('.' + eq).empty();
                    $('.' + eq).append("<option value=''>请选择货位</option>");
                    for (var i in data) {
                        $('.' + eq).append("<option value=" + data[i].cargoNo + ">" + data[i].cargoNo + "</option>")
                    }
                }else{
                    layer.msg(data.msg,{icon:2,time:2000});
                }
            }
        })
    }

    /*移入仓下拉框改变事件——改变下拉框后判断出仓入仓是否为两个不同的仓库*/
    $('#inwarehouse').bind('change', function () {
        var ware = $('#inwarehouse').val();
        var warehouse = $('#iomName').val();
        var warename = $("#iomName option:selected").text();
        var iomname = $('#iomGoods').val();
        if (ware == warename) {
            layer.msg("仓库名不能相同！", {icon: 2, time: 1000});
            $('#inwarehouse').val("请选择仓库");
        } else {
            $.ajax({
                url: "[[@{/transfer/search}]]",
                async: false,
                data: {
                    id: warehouse,
                    iomGoods: iomname
                },
                success: function (data) {
                    if(data.rs){
                        var data = data.data;
                        $('#inTable tbody').empty();
                        for (var i in data) {
                            $('#inTable tbody').append("<tr></tr>");
                            $('#inTable tr:last').append("<td>" + i + "</td>");
                            $('#inTable tr:last').append("<td>" + data[i].lcode + "</td><input type='hidden' name='iomDetails[" + i + "].iomGoodsno' value=" + data[i].lcode + " />");
                            $('#inTable tr:last').append("<td>" + data[i].product + "</td><input type='hidden' name='iomDetails[" + i + "].iomGoods' value=" + data[i].product + " />");
                            $('#inTable tr:last').append("<td>" + ware + "</td><input type='hidden' name='iomDetails[" + i + "].iomName' value=" + data[i].wareName + " />");
                            $('#inTable tr:last').append("<td><select onchange='area(this,\"shelves" + i + "\",\"cargo" + i + "\")' name='iomDetails[" + i + "].iomArea' class=\"area\" style=\"margin-left:10px;\">\n" +
                                "           <option value=''>请选择货区</option>\n" +
                                "          </select></td>");
                            $('#inTable tr:last').append("<td><select onchange='shelves(this,\"cargo" + i + "\")' name='iomDetails[" + i + "].iomShelves' class='shelves" + i + "' style=\"margin-left:10px;\">\n" +
                                "            <option >请选择货架</option>\n" +
                                "          </select></td>");
                            $('#inTable tr:last').append("<td><select name='iomDetails[" + i + "].iomCargoloca' class=\"cargo" + i + " cargo\" style=\"margin-left:10px;\">\n" +
                                "            <option >请选择货位</option>\n" +
                                "          </select></td>");
                        }
                    }else{
                        layer.msg(data.msg,{icon:2,time:2000});
                    }

                }
            })
            $.ajax({
                url: "[[@{/transfer/findArea}]]",
                async: false,
                data: {
                    ware: ware
                },
                success: function (data) {
                    if(data.rs){
                        var data = data.data;
                        for (var i in data) {
                            $('.area').append("<option value=" + data[i].id + ">" + data[i].goodsName + "</option>")
                        }
                    }else{
                        layer.msg(data.msg,{icon:2,time:2000});
                    }
                }

            })
        }

    })


    /*出库仓库+商品名搜索按钮点击事件*/
    $('#search').on('click', function () {
        var warehouse = $('#iomName').val();
        var iomname = $('#iomGoods').val();
        $.ajax({
            url: "[[@{/transfer/search}]]",
            data: {
                id: warehouse,
                iomGoods: iomname
            },
            success: function (data) {
               if(data.rs){
                   var data = data.data;
                   $('#outTable tbody').empty();
                   for (var i in data) {
                       $('#outTable tbody').append("<tr></tr>");
                       $('#outTable tr:last').append("<td>" + i + "</td>");
                       $('#outTable tr:last').append("<td>" + data[i].lcode + "</td><input type='hidden' name='moveDetails[" + i + "].lcode' value=" + data[i].lcode + " />");
                       $('#outTable tr:last').append("<td>" + data[i].product + "</td><input type='hidden' name='moveDetails[" + i + "].product' value=" + data[i].product + " />");
                       $('#outTable tr:last').append("<td>" + data[i].wareName + "</td><input type='hidden' name='moveDetails[" + i + "].wareName' value=" + data[i].wareName + " />");
                       $('#outTable tr:last').append("<td>" + data[i].goodsName + "</td><input type='hidden' name='moveDetails[" + i + "].goodsName' value=" + data[i].goodsName + " />");
                       $('#outTable tr:last').append("<td>" + data[i].shelvesId + "</td><input type='hidden' name='moveDetails[" + i + "].shelvesId' value=" + data[i].shelvesId + " />");
                       $('#outTable tr:last').append("<td>" + data[i].cargoNo + "</td><input type='hidden' name='moveDetails[" + i + "].cargoNo' value=" + data[i].cargoNo + " />");
                   }
               }else{
                   layer.msg(data.msg,{icon:2,time:2000});
               }
            }
        })
    })


    /*点击移库操作时-去寻找所有的仓库 并相应放在出库下拉框和入库下拉框上*/
    $('#property_add').on('click', function () {
        $.ajax({
            url: "[[@{/transfer/allware}]]",
            success: function (data) {
               if(data.rs){
                   var data = data.data;
                   $('#iomName').empty();
                   $('#inwarehouse').empty();
                   $('#iomName').append("<option value=''>请选择仓库</option>");
                   $('#inwarehouse').append("<option value=''>请选择仓库</option>");
                   for (var i in data) {
                       $('#iomName').append("<option value=" + data[i].id + ">" + data[i].wareName + "</option>")
                       $('#inwarehouse').append("<option value=" + data[i].wareName + ">" + data[i].wareName + "</option>")
                   }
               }else{
                   layer.msg(data.msg,{icon:2,time:2000});
               }
            }
        })
        layer.open({
            type: 1,
            title: '移库申请',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area: ['1000px', ''],
            content: $('#add_menber_style'),
            btn: ['提交', '取消'],
            yes: function (index, layero) {
                var num = 0;
                var str = "";
                $(".add_menber input[type$='text']").each(function (n) {
                    if ($(this).val() == "") {

                        layer.alert(str += "" + $(this).attr("name") + "不能为空！\r\n", {
                            title: '提示框',
                            icon: 0,
                        });
                        num++;
                        return false;
                    }
                });
                $("select").each(function (n) {
                    if ($(this).val() == "") {
                        num++;
                        layer.alert(str += "" + $(this).context.parentElement.children[0].firstElementChild.text.split("请选择", 2)[1] + "不能为空！\r\n", {
                            title: '提示框',
                            icon: 0,
                        });
                        return false;
                    }
                });
                var rows = $("#inTable tbody").find("tr").length;
                $('#inTable .cargo').css("border", "1px solid #D5D5D5");
                for (var i = 0; i < rows; i++) {
                    for (var j = i + 1; j < rows; j++) {
                        var one = $("select[name='iomDetails[" + i + "].iomCargoloca']").val();
                        var two = $("select[name='iomDetails[" + j + "].iomCargoloca']").val();
                        if (one == two) {
                            num++;
                            layer.msg("货位不能相同！", {icon: 2, time: 1000});
                            $("select[name='iomDetails[" + i + "].iomCargoloca']").css("border", "1px solid #f00");
                            $("select[name='iomDetails[" + j + "].iomCargoloca']").css("border", "1px solid #f00");
                        }
                    }
                }
                if (num > 0) {
                    return false;
                } else {
                    var data = $('form').serialize();
                    $.ajax({
                        url: '/transfer/submission',
                        type: "post",
                        data: data,
                        success: function (d) {
                            layer.alert('申请成功！', {
                                title: '提示框',
                                icon: 1,
                            });
                            layer.close(index);
                            window.parent.document.getElementById('iframe').contentWindow.location.reload(true);
                        }
                    })
                }
            }
        });
    });

    /*点击单条信息的详情按钮，获取移库记录的批次号（batch），获取该记录的详细记录*/
    function details(eq) {
        var id = $(eq).parent().parent().children("td:eq(1)").text();
        $.ajax({
            url: '/transfer/allDetails',
            data: {
                batch: id
            },
            async: false,
            type: 'get',
            dataType: 'json',
            success: function (data) {
                if(data.rs){
                    var data = data.data;
                    $('#outwarehouse').text(data.mvOut)
                    $('#product').text(data.mvGoods)
                    $('#interware').text(data.mvIn)
                    $('#name').text(data.mvPerson)
                    $('#telp').text(data.mvTel)
                    $('#time').text(data.mvTime)
                    $('#num').text(data.mvNumber)
                    $('#reason').text(data.mvMark)
                }else{
                    layer.msg(data.msg,{icon:2,time:2000});
                }
            }

        });
        var outware = document.getElementById('outwarehouse').innerText;
        $.ajax({
            url: '/transfer/outWare',
            async: false,
            data: {
                id: id,
                outware: outware
            },
            type: 'get',
            dataType: 'json',
            success: function (data) {
                if(data.rs){
                    var data = data.data;
                    $('#check_one-table tbody').empty();
                    for (var i in data) {
                        $('#check_one-table tbody').append("<tr></tr>");
                        $('#check_one-table tr:last').append("<td>" + i + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomGoodsno + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomGoods + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomName + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomArea + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomShelves + "</td>");
                        $('#check_one-table tr:last').append("<td>" + data[i].iomCargoloca + "</td>");

                    }
                }else{
                    layer.msg(data.msg,{icon:2,time:2000});
                }
            }
        });
        var inware = $('#interware').text();
        $.ajax({
            url: '/transfer/outWare',
            async: false,
            data: {
                id: id,
                outware: inware
            },
            type: 'get',
            dataType: 'json',
            success: function (data) {
                if(data.rs){
                    var data =data.data;
                    $('#check_two-table tbody').empty();
                    for (var i in data) {
                        $('#check_two-table tbody').append("<tr></tr>");
                        $('#check_two-table tr:last').append("<td>" + i + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomGoodsno + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomGoods + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomName + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomArea + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomShelves + "</td>");
                        $('#check_two-table tr:last').append("<td>" + data[i].iomCargoloca + "</td>");
                    }
                }else{
                    layer.msg(data.msg,{icon:2,time:2000});
                }
            }
        });
        layer.open({
            type: 1,
            title: '移库详情',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area: ['1000px', ''],
            content: $('#list_menber_style'),
            btn: ['返回'],
            yes: function (index, layero) {
                var num = 0;
                var str = "";
                $(".list_menber input[type$='text']").each(function (n) {
                    if ($(this).val() == "") {

                        layer.alert(str += "" + $(this).attr("name") + "不能为空！\r\n", {
                            title: '提示框',
                            icon: 0,
                        });
                        num++;
                        return false;
                    }
                });
                if (num > 0) {
                    return false;
                } else {
                    layer.close(index);
                }
            }
        });
    };
    $(function () {
        $(".displayPart").displayPart();
    });

    /*分页的JQuery函数*/
    jQuery(function ($) {
        var shitTable = $('#main-table').dataTable({
            searching: false,  //取消本地搜索框
            serverSide: true,   //开始服务器分页
            pageLength: 10,
            ajax: {
                url: '/transfer/list',
                type: 'post',
                data: function (d) {
                    //获取分页信息
                    var searchParams = {
                        start: d.start,
                        length: d.length,
                    };
                }
            },
            columns: [
                {
                    "data": "id", "createdCell": function (td, cellData, rowData, row, col) {
                        $(td).text(row + 1);
                    }
                },
                {"data": "mvNo"},
                {"data": "mvOut"},
                {"data": "mvIn"},
                {"data": "mvGoods"},
                {"data": "mvNumber"},
                {"data": "mvMark"},
                {"data": "mvPerson"},
                {"data": "mvTel"},
                {"data": "mvTime"},
                {
                    "data": "mvTime", "createdCell": function (td, cellData, rowData, row, col) {
                        $(td).empty().append('<a style="text-decoration:none" onclick="details(this)" class="btn btn-xs btn-success property_list"  href="javascript:;" title="移库详情"><i class="icon-list bigger-120"></i></a>');
                    }
                },
            ]
        })
    })
    //面包屑返回值
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.iframeAuto(index);
    $('.Refund_detailed').on('click', function () {
        var cname = $(this).attr("title");
        var chref = $(this).attr("href");
        var cnames = parent.$('.Current_page').html();
        var herf = parent.$("#iframe").attr("src");
        parent.$('#parentIframe').html(cname);
        parent.$('#iframe').attr("src", chref).ready();
        ;
        parent.$('#parentIframe').css("display", "inline-block");
        parent.$('.Current_page').attr({"name": herf, "href": "javascript:void(0)"}).css({
            "color": "#4c8fbd",
            "cursor": "pointer"
        });
        //parent.$('.Current_page').html("<a href='javascript:void(0)' name="+herf+" class='iframeurl'>" + cnames + "</a>");
        parent.layer.close(index);

    });

</script>